package com.ruoyi.web.controller.his;

import java.util.List;

import com.ruoyi.his.domain.vo.HisDockorVo;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.his.domain.HisDockor;
import com.ruoyi.his.service.IHisDockorService;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;

/**
 * 【请填写功能名称】Controller
 * 
 * @author Alan
 * @date 2024-03-09
 */
@RestController
@RequestMapping("/his/dockor")
public class HisDockorController extends BaseController
{
    @Autowired
    private IHisDockorService hisDockorService;

    /**
     * 根据
     */
    @GetMapping("/list")
    public TableDataInfo list(HisDockor hisDockor)
    {
        startPage();
        List<HisDockorVo> list = hisDockorService.selectDockorList(hisDockor);
        return getDataTable(list);
    }


    /**
     * 获取【请填写功能名称】详细信息
     */
    @GetMapping(value = "/{id}")
    public AjaxResult getInfo(@PathVariable("id") Long id)
    {
        return AjaxResult.success(hisDockorService.selectHisDockorById(id));
    }

    /**
     * 获取【请填写功能名称】详细信息
     */
    @DeleteMapping(value = "/{id}")
    public AjaxResult delete(@PathVariable("id") Long id)
    {
        return AjaxResult.success(hisDockorService.deleteHisDockorById(id));
    }

    /**
     * 修改【请填写功能名称】
     */
//    @PreAuthorize("@ss.hasPermi('his:dockor:edit')")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
    @PutMapping
    public AjaxResult edit(@RequestBody HisDockor hisDockor)
    {
        return toAjax(hisDockorService.updateHisDockor(hisDockor));
    }


}
